//
//  TwentySixViewController.m
//  项目二
//
//  Created by rimi on 16/5/17.
//  Copyright © 2016年 objective. All rights reserved.
//

#import "TwentySixViewController.h"
#import "Datai21ViewController.h"
@interface TwentySixViewController ()<Datai21ViewControllerDalegate>
@property (nonatomic,strong)UILabel *agelabel;
@end

@implementation TwentySixViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.title = @"协议传值";
    
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"添加闹钟" style:UIBarButtonItemStylePlain target:self action:@selector(btnTaped:)];
    
    _agelabel = [[UILabel alloc]initWithFrame:CGRectMake(200, 200, 200, 50)];
    _agelabel.text = @"name";
    _agelabel.backgroundColor = [UIColor cyanColor];
    [self.view addSubview:_agelabel];
    
}
- (void)btnTaped:(UIBarButtonItem *)sender{
    UIStoryboard *story = [UIStoryboard storyboardWithName:@"Storyboard21" bundle:nil];
    Datai21ViewController *VC = [story instantiateViewControllerWithIdentifier:@"Datai21ViewController"];
    VC.dalegate = self;
    
    [self.navigationController pushViewController:VC animated:YES];

}

-(void)givemeTime:(NSString *)timeStr{
    _agelabel.text = timeStr;
}
@end
